<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //数组的两种创建方式
        //1.利用数组字面量
        var arr = [1, 2, 3];
        console.log(arr[0]);

        //2.利用new Array()
        var arr1 = new Array(); //创建一个空的数组
        var arr1 = new Array(2); //创建了长度为2 但是为空的数组元素
        console.log(arr1);

        var arr2 = new Array(2, 3); //等价于[2,3]
        console.log(arr2);
    </script>
</head>

<body>

</body>

</html>